Page({
  onShareAppMessage() {
    return {
      title: 'rich-text',
      path: 'packageComponent/pages/content/rich-text/rich-text'
    }
  },

  data: {
    schema: [{
      label:'节点',
      prop:'nodes',
      type:'textarea'
    },{
      label:'显示连续空格',
      prop:'space',
      type:'picker',
      labelOptions:['中文字符空格一半大小','中文字符空格大小','根据字体设置的空格大小'],
      valueOptions:['ensp','emsp','nbsp']
    },{
      label:'布局兼容模式',
      prop:'mode',
      type:'picker',
      labelOptions:['default','compat','aggressive','web','web-static'],
      valueOptions:['default','compat','aggressive','web','web-static']
    }],
    formData: {
      nodes:`<div class="div_class">
      <h1>Title</h1>
      <p class="p">
        Life is&nbsp;<i>like</i>&nbsp;a box of
        <b>&nbsp;chocolates</b>.
      </p>
    </div>
    `,
      space:'nbsp',
      mode:'default'
    },
    title: '',
    result: '',
    zh:'',
    apiType: '',
    remark: '',
    webUrl: '',
    apiName: '',
  },
  onLoad(options) {
    this.setData({
      apiType: options.zh,
      title: options.title,
      zh: options.zh,
      remark: options.remark,
      webUrl: options.webUrl
    })
  },
  getFormData(e){
    this.setData({
      formData:e.detail.formData
    })
  }
})
